import Vue from 'vue'
import VueRouter from 'vue-router'
import Home from '../views/Home.vue'

Vue.use(VueRouter)

const routes = [
  {path:'/',redirect:'/welcome'},
  {
    path: '/welcome',
    name: 'Welcome',
    component: () => import('../views/welcome.vue')
  },
  {
    path: '/home',
    name: 'Home',
    component: Home
  },
  {
    path: '/music',
    name: 'Music',
    component: () => import('../views/Music.vue')
  },
  {
    path: '/musicDetail',
    name: 'MusicDetail',
    component: () => import('../views/MusicDetail.vue')
  },
  {
    path: '/top250',
    name: 'Top250',
    component: () => import('../views/Top250.vue')
  },
  {
    path: '/topDetail',
    name: 'TopDetail',
    component: () => import('../views/TopDetail.vue')
  }
]

const router = new VueRouter({
  mode: 'history',
  base: process.env.BASE_URL,
  routes
})

export default router
